using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class OR_BookingMap : EntityTypeConfiguration<OR_Booking>
    {
        public OR_BookingMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.ID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.PrimaryOperation)
                .HasMaxLength(10);

            this.Property(t => t.Description)
                .HasMaxLength(100);

            this.Property(t => t.Priority)
                .HasMaxLength(2);

            this.Property(t => t.Number)
                .HasMaxLength(20);

            this.Property(t => t.Notes)
                .HasMaxLength(300);

            this.Property(t => t.Status)
                .HasMaxLength(2);

            // Table & Column Mappings
            this.ToTable("OR_Booking");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.PrimaryOperation).HasColumnName("PrimaryOperation");
            this.Property(t => t.Description).HasColumnName("Description");
            this.Property(t => t.PatientIID).HasColumnName("PatientIID");
            this.Property(t => t.SurgeonIID).HasColumnName("SurgeonIID");
            this.Property(t => t.Duration).HasColumnName("Duration");
            this.Property(t => t.AnesthetistIID).HasColumnName("AnesthetistIID");
            this.Property(t => t.Priority).HasColumnName("Priority");
            this.Property(t => t.BloodRequired).HasColumnName("BloodRequired");
            this.Property(t => t.Endoscopy).HasColumnName("Endoscopy");
            this.Property(t => t.Room).HasColumnName("Room");
            this.Property(t => t.RequestDate).HasColumnName("RequestDate");
            this.Property(t => t.BookingDate).HasColumnName("BookingDate");
            this.Property(t => t.Number).HasColumnName("Number");
            this.Property(t => t.Notes).HasColumnName("Notes");
            this.Property(t => t.USERID).HasColumnName("USERID");
            this.Property(t => t.Status).HasColumnName("Status");
        }
    }
}
